<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" integrity="sha256-Z1K5uhUaJXA7Ll0XrZ/0JhX4lAtZFpT6jkKrEDT0drU=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/themes/pink/pace-theme-minimal.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/pace.min.js" integrity="sha256-gqd7YTjg/BtfqWSwsJOvndl0Bxc8gFImLEkXQT8+qj0=" crossorigin="anonymous"></script>

<script class="next-config" data-name="main" type="application/json">{"hostname":"zonggc.github.io","root":"/","images":"/images","scheme":"Gemini","darkmode":false,"version":"8.14.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":true,"style":"flat"},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":true,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="NexT 主题功能添加及美化配置">
<meta property="og:type" content="article">
<meta property="og:title" content="NexT 主题配置">
<meta property="og:url" content="https://zonggc.github.io/hexo/theme/next/blog/hexo/theme/next/next-config/index.html">
<meta property="og:site_name" content="无敌的帽子">
<meta property="og:description" content="NexT 主题功能添加及美化配置">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://zonggc.github.io/hexo/theme/next/blog/hexo/theme/next/next-config/tag-example-1.png">
<meta property="og:image" content="https://zonggc.github.io/hexo/theme/next/blog/hexo/theme/next/next-config/tag-example-2.png">
<meta property="article:published_time" content="2022-12-24T14:00:23.000Z">
<meta property="article:modified_time" content="2022-12-28T11:44:03.692Z">
<meta property="article:author" content="zonggc">
<meta property="article:tag" content="博客">
<meta property="article:tag" content="hexo">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://zonggc.github.io/hexo/theme/next/blog/hexo/theme/next/next-config/tag-example-1.png">


<link rel="canonical" href="https://zonggc.github.io/hexo/theme/next/blog/hexo/theme/next/next-config/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://zonggc.github.io/hexo/theme/next/blog/hexo/theme/next/next-config/","path":"hexo/theme/next/blog/hexo/theme/next/next-config/","title":"NexT 主题配置"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>NexT 主题配置 | 无敌的帽子</title>
  






  <script async defer data-website-id="" src=""></script>

  <script defer data-domain="" src=""></script>

  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">无敌的帽子</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">zonggc.github.io</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li><li class="menu-item menu-item-schedule"><a href="/schedule/" rel="section"><i class="fa fa-calendar fa-fw"></i>日程表</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#%F0%9F%8C%9F%E6%B7%BB%E5%8A%A0%E9%98%85%E8%AF%BB%E5%85%A8%E6%96%87"><span class="nav-number">1.</span> <span class="nav-text">🌟添加阅读全文</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%F0%9F%8C%9F%E4%BF%AE%E6%94%B9%E4%B8%BB%E9%A2%98%E5%AD%97%E4%BD%93%E5%A4%A7%E5%B0%8F"><span class="nav-number">2.</span> <span class="nav-text">🌟修改主题字体大小</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%F0%9F%8C%9F%E9%9A%90%E8%97%8F%E5%BA%95%E9%83%A8-%E7%94%B1-Hexo-amp-NexT-Gemini-%E5%BC%BA%E5%8A%9B%E9%A9%B1%E5%8A%A8-%E6%96%87%E5%AD%97"><span class="nav-number">3.</span> <span class="nav-text">🌟隐藏底部 由 Hexo &amp; NexT.Gemini 强力驱动 文字</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%F0%9F%8C%9F%E6%B5%8F%E8%A7%88%E8%BF%9B%E5%BA%A6"><span class="nav-number">4.</span> <span class="nav-text">🌟浏览进度</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%F0%9F%8C%9F%E4%BF%AE%E6%94%B9%E5%9B%BE%E6%A0%87"><span class="nav-number">5.</span> <span class="nav-text">🌟修改图标</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%F0%9F%8C%9F%E4%BF%AE%E6%94%B9%E6%A0%87%E7%AD%BE%E7%9A%84-%E4%B8%BA%E5%9B%BE%E6%A0%87"><span class="nav-number">6.</span> <span class="nav-text">🌟修改标签的#为图标</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%F0%9F%8C%9F%E5%A2%9E%E5%8A%A0%E6%96%87%E7%AB%A0%E5%AD%97%E6%95%B0%E7%BB%9F%E8%AE%A1%E5%8F%8A%E9%98%85%E8%AF%BB%E6%97%B6%E9%95%BF%E5%8A%9F%E8%83%BD"><span class="nav-number">7.</span> <span class="nav-text">🌟增加文章字数统计及阅读时长功能</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%F0%9F%8C%9F%E9%85%8D%E7%BD%AE%E9%A1%B6%E9%83%A8%E5%8A%A0%E8%BD%BD%E6%9D%A1"><span class="nav-number">8.</span> <span class="nav-text">🌟配置顶部加载条</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="zonggc"
      src="https://avatars.githubusercontent.com/u/43042779?v=4">
  <p class="site-author-name" itemprop="name">zonggc</p>
  <div class="site-description" itemprop="description">欢迎回来</div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">11</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">6</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">7</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <a href="https://github.com/zonggc" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;zonggc" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
  </div>
<div class="cc-license animated" itemprop="sponsor">
  <a href="https://www.netlify.com" class="cc-opacity" title="Deploy with Netlify → https://www.netlify.com" target="_blank"><img width="80" src="https://www.netlify.com/img/global/badges/netlify-dark.svg" alt="Netlify"></a>
</div>

        </div>
      </div>
        <div class="back-to-top animated" role="button" aria-label="返回顶部">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://zonggc.github.io/hexo/theme/next/blog/hexo/theme/next/next-config/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://avatars.githubusercontent.com/u/43042779?v=4">
      <meta itemprop="name" content="zonggc">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="无敌的帽子">
      <meta itemprop="description" content="欢迎回来">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="NexT 主题配置 | 无敌的帽子">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          NexT 主题配置
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2022-12-24 22:00:23" itemprop="dateCreated datePublished" datetime="2022-12-24T22:00:23+08:00">2022-12-24</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2022-12-28 19:44:03" itemprop="dateModified" datetime="2022-12-28T19:44:03+08:00">2022-12-28</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/hexo/" itemprop="url" rel="index"><span itemprop="name">hexo</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/hexo/theme/" itemprop="url" rel="index"><span itemprop="name">theme</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/hexo/theme/next/" itemprop="url" rel="index"><span itemprop="name">next</span></a>
        </span>
    </span>

  
    <span class="post-meta-break"></span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>848</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>3 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <p>NexT 主题功能添加及美化配置</p>
<span id="more"></span>

<ul>
<li>Hexo: 6.3.0</li>
<li>NexT: 8.14.0</li>
</ul>
<hr>
<h3 id="🌟添加阅读全文"><a href="#🌟添加阅读全文" class="headerlink" title="🌟添加阅读全文"></a>🌟添加阅读全文</h3><p>NexT 提供三种方式来控制文章在首页的显示方式。 也就是说，在首页显示文章的摘录并显示 <strong>阅读全文</strong> 按钮，可以通过以下方法：</p>
<ol>
<li><p>在文章中使用 <code>&lt;!-- more --&gt;</code> 手动进行截断，Hexo 提供的方式 <strong>推荐</strong></p>
</li>
<li><p>在文章的 <a target="_blank" rel="noopener" href="https://hexo.io/docs/front-matter.html">front-matter</a> 中添加 <code>description</code>，并提供文章摘录</p>
</li>
<li><p>自动形成摘要，在 <strong>主题配置文件</strong> 中添加：</p>
<figure class="highlight yaml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">auto_excerpt:</span></span><br><span class="line">  <span class="attr">enable:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">length:</span> <span class="number">150</span></span><br></pre></td></tr></tbody></table></figure>

<p>默认截取的长度为 <code>150</code> 字符，可以根据需要自行设定</p>
</li>
</ol>
<blockquote>
<p>建议使用 <code>&lt;!-- more --&gt;</code>（即第一种方式），除了可以精确控制需要显示的摘录内容以外， 这种方式也可以让 Hexo 中的插件更好的识别。</p>
</blockquote>
<hr>
<h3 id="🌟修改主题字体大小"><a href="#🌟修改主题字体大小" class="headerlink" title="🌟修改主题字体大小"></a>🌟修改主题字体大小</h3><ul>
<li>自定义样式文件</li>
<li> NexT 配置文件 打开自定义文件的路径</li>
</ul>
<blockquote>
<p>参考：<a target="_blank" rel="noopener" href="https://theme-next.js.org/docs/advanced-settings/custom-files.html#Examples-of-Modifying-Style">自定义文件 | NexT (theme-next.js.org)</a></p>
</blockquote>
<figure class="highlight yaml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">custom_file_path:</span></span><br><span class="line">  <span class="attr">variable:</span> <span class="string">source/_data/variables.styl</span></span><br></pre></td></tr></tbody></table></figure>

<ul>
<li>在站点根目录中创建和编辑并添加变量：<code>source/_data/variables.styl</code></li>
</ul>
<blockquote>
<p>可以复制 <code>node_modules\hexo-theme-next\source\css\_variables\base.styl</code> 主题下的变量</p>
</blockquote>
<figure class="highlight less"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$<span class="selector-tag">font-size-large</span>          = <span class="number">1em</span>;</span><br><span class="line">$<span class="selector-tag">font-size-larger</span>         = <span class="number">1em</span>;</span><br></pre></td></tr></tbody></table></figure>



<ul>
<li>也可以 在主题配置文件<code>_config.yml</code> 文件中搜索 <code>font</code></li>
<li>配置 <code>font.enable:true</code>, 配置 <code>xx.external:false</code> 要不然博客访问速度变慢 </li>
</ul>
<figure class="highlight yaml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">font:</span></span><br><span class="line">  <span class="attr">enable:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">host:</span></span><br><span class="line">  <span class="attr">global:</span></span><br><span class="line">    <span class="attr">external:</span> <span class="literal">true</span></span><br><span class="line">    <span class="attr">family:</span> <span class="string">Lato</span></span><br><span class="line">    <span class="attr">size:</span></span><br></pre></td></tr></tbody></table></figure>

<hr>
<h3 id="🌟隐藏底部-由-Hexo-amp-NexT-Gemini-强力驱动-文字"><a href="#🌟隐藏底部-由-Hexo-amp-NexT-Gemini-强力驱动-文字" class="headerlink" title="🌟隐藏底部 由 Hexo &amp; NexT.Gemini 强力驱动 文字"></a>🌟隐藏底部 <code>由 Hexo &amp; NexT.Gemini 强力驱动</code> 文字</h3><ul>
<li>在主题配置文件<code>_config.yml</code> 中搜索 <code>footer</code> 修改 <code>footer.powered</code> 值为 <code>false</code></li>
</ul>
<figure class="highlight yaml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">footer:</span></span><br><span class="line">  <span class="comment">#...</span></span><br><span class="line">  <span class="comment"># Powered by Hexo &amp; NexT</span></span><br><span class="line">  <span class="attr">powered:</span> <span class="literal">true</span></span><br></pre></td></tr></tbody></table></figure>

<hr>
<h3 id="🌟浏览进度"><a href="#🌟浏览进度" class="headerlink" title="🌟浏览进度"></a>🌟浏览进度</h3><ul>
<li>在主题配置文件<code>_config.yml</code> 中搜索 <code>scrollpercent</code> 修改 <code>footer.powered</code> 值为 <code>false</code></li>
</ul>
<figure class="highlight yaml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">back2top:</span></span><br><span class="line">  <span class="comment"># 启用回到顶部</span></span><br><span class="line">  <span class="attr">enable:</span> <span class="literal">true</span></span><br><span class="line">  <span class="comment"># true:sidebar 底部显示，</span></span><br><span class="line">  <span class="comment"># false: 右下角显示</span></span><br><span class="line">  <span class="attr">sidebar:</span> <span class="literal">true</span></span><br><span class="line">  <span class="comment"># 开启浏览百分比标签</span></span><br><span class="line">  <span class="attr">scrollpercent:</span> <span class="literal">true</span></span><br></pre></td></tr></tbody></table></figure>

<hr>
<h3 id="🌟修改图标"><a href="#🌟修改图标" class="headerlink" title="🌟修改图标"></a>🌟修改图标</h3><ul>
<li>准备一张（32 * 32）的 ico 图标，png 格式也可以，命名为 <code>favicon</code>。</li>
<li>然后把图标放在 <code>/themes/hexo-theme-next/source/images</code> 里</li>
<li>在主题配置文件<code>_config.yml</code> 中搜索 <code>favicon</code> 修改 <code>favicon.small</code> 和 <code>favicon.medium</code> 值为 <code>images/favicon.png</code></li>
</ul>
<figure class="highlight yaml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">favicon:</span></span><br><span class="line">  <span class="comment">#small: /images/favicon-16x16-next.png</span></span><br><span class="line">  <span class="comment">#medium: /images/favicon-32x32-next.png</span></span><br><span class="line">  <span class="attr">small:</span> <span class="string">/images/favicon.png</span></span><br><span class="line">  <span class="attr">medium:</span> <span class="string">/images/favicon.png</span></span><br><span class="line">  <span class="attr">apple_touch_icon:</span> <span class="string">/images/apple-touch-icon-next.png</span></span><br><span class="line">  <span class="attr">safari_pinned_tab:</span> <span class="string">/images/logo.svg</span></span><br><span class="line">  <span class="comment">#android_manifest: /images/manifest.json</span></span><br><span class="line">  <span class="comment">#ms_browserconfig: /images/browserconfig.xml</span></span><br></pre></td></tr></tbody></table></figure>

<hr>
<h3 id="🌟修改标签的-为图标"><a href="#🌟修改标签的-为图标" class="headerlink" title="🌟修改标签的#为图标"></a>🌟修改标签的<code>#</code>为图标</h3><ul>
<li>修改模板 <code>/themes/hexo-theme-next/layout/_macro/post.swig</code> 搜索 <code>rel="tag"</code> 如图：</li>
<li>网上的教程大部分都是让替换 <code>rel="tag"&gt;#</code> 但其实新版本已经支持了，如图就是新版本的代码，</li>
<li>只需要在主题配置文件<code>_config.yml</code> 中搜索 <code>tag_icon</code> 修改 <code>tag_icon: false</code> 为 <code>true</code></li>
</ul>
<figure class="highlight html"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">footer</span> <span class="attr">class</span>=<span class="string">"post-footer"</span>&gt;</span></span><br><span class="line">  {%- if post.tags and post.tags.length %}</span><br><span class="line">    {%- if theme.tag_icon %}</span><br><span class="line">      {%- set tag_indicate = '<span class="tag">&lt;<span class="name">i</span> <span class="attr">class</span>=<span class="string">"fa fa-tag"</span>&gt;</span><span class="tag">&lt;/<span class="name">i</span>&gt;</span>' %}</span><br><span class="line">    {% else %}</span><br><span class="line">      {%- set tag_indicate = '#' %}</span><br><span class="line">    {%- endif %}</span><br><span class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"post-tags"</span>&gt;</span></span><br><span class="line">      {%- for tag in post.tags.toArray() %}</span><br><span class="line">        <span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">"{{ url_for(tag.path) }}"</span> <span class="attr">rel</span>=<span class="string">"tag"</span>&gt;</span>{{ tag_indicate }} {{ tag.name }}<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">      {%- endfor %}</span><br><span class="line">    <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">  {%- endif %}</span><br><span class="line"></span><br><span class="line">  {{ partial('_partials/post/post-footer.swig', {}, {cache: theme.cache.enable}) }}</span><br><span class="line"></span><br><span class="line">  {{ post_nav(post) }}</span><br><span class="line"><span class="tag">&lt;/<span class="name">footer</span>&gt;</span></span><br></pre></td></tr></tbody></table></figure>

<p>如图：<br>未修改：<img src="/hexo/theme/next/blog/hexo/theme/next/next-config/tag-example-1.png" alt="未修改标签图片"> 已修改：<img src="/hexo/theme/next/blog/hexo/theme/next/next-config/tag-example-2.png" alt="未修改标签图片"></p>
<hr>
<h3 id="🌟增加文章字数统计及阅读时长功能"><a href="#🌟增加文章字数统计及阅读时长功能" class="headerlink" title="🌟增加文章字数统计及阅读时长功能"></a>🌟增加文章字数统计及阅读时长功能</h3><ul>
<li>安装插件 <code>hexo-wordcount</code></li>
</ul>
<figure class="highlight applescript"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-<span class="built_in">word</span>-counter  <span class="comment">--save</span></span><br><span class="line">hexo clean</span><br></pre></td></tr></tbody></table></figure>

<ul>
<li>站点配置文件<code>_config.yml</code> 中添加 </li>
</ul>
<figure class="highlight yaml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># word_count</span></span><br><span class="line"><span class="attr">symbols_count_time:</span></span><br><span class="line">  <span class="attr">symbols:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">time:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">total_symbols:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">total_time:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">exclude_codeblock:</span> <span class="literal">false</span></span><br><span class="line">  <span class="attr">awl:</span> <span class="number">4</span></span><br><span class="line">  <span class="attr">wpm:</span> <span class="number">275</span></span><br><span class="line">  <span class="attr">suffix:</span> <span class="string">"mins."</span></span><br></pre></td></tr></tbody></table></figure>

<ul>
<li>在主题配置文件<code>_config.next.yml</code> 中搜索 <code>symbols_count_time</code>, 修改如下:</li>
</ul>
<figure class="highlight yaml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">symbols_count_time:</span></span><br><span class="line">  <span class="attr">separated_meta:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">item_text_total:</span> <span class="literal">true</span></span><br></pre></td></tr></tbody></table></figure>

<hr>
<h3 id="🌟配置顶部加载条"><a href="#🌟配置顶部加载条" class="headerlink" title="🌟配置顶部加载条"></a>🌟配置顶部加载条</h3><ul>
<li>在主题配置文件<code>_config.next.yml</code> 中搜索 <code>pace</code>, 修改如下:</li>
</ul>
<figure class="highlight yaml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># For more information: https://github.com/CodeByZach/pace</span></span><br><span class="line"><span class="attr">pace:</span></span><br><span class="line">  <span class="attr">enable:</span> <span class="literal">true</span></span><br><span class="line">  <span class="comment"># All available colors:</span></span><br><span class="line">  <span class="comment"># black | blue | green | orange | pink | purple | red | silver | white | yellow</span></span><br><span class="line">  <span class="attr">color:</span> <span class="string">pink</span></span><br><span class="line">  <span class="comment"># All available themes:</span></span><br><span class="line">  <span class="comment"># big-counter | bounce | barber-shop | center-atom | center-circle | center-radar | center-simple</span></span><br><span class="line">  <span class="comment"># corner-indicator | fill-left | flat-top | flash | loading-bar | mac-osx | material | minimal</span></span><br><span class="line">  <span class="attr">theme:</span> <span class="string">corner-indicator</span></span><br></pre></td></tr></tbody></table></figure>

<hr>

    </div>

    
    
    

    <footer class="post-footer"><script src="//sdk.jinrishici.com/v2/browser/jinrishici.js"></script>
<script>
  jinrishici.load((result) => {
    let jrsc = document.getElementById('jrsc');
    const data = result.data;
    let author = data.origin.author;
    let title = '《' + data.origin.title + '》';
    let content = data.content.substr(0, data.content.length - 1);
    let dynasty = data.origin.dynasty.substr(0, data.origin.dynasty.length - 1);
    jrsc.innerText = content + ' @ ' + dynasty + '·' + author + title;
  });
</script>
<div style="text-align: center"><span id="jrsc" >正在加载今日诗词....</span></div>

          <div class="post-tags">
              <a href="/tags/%E5%8D%9A%E5%AE%A2/" rel="tag"><i class="fa fa-tag"></i> 博客</a>
              <a href="/tags/hexo/" rel="tag"><i class="fa fa-tag"></i> hexo</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/hexo/deploy/blog/hexo/deploy/deploy-gitee/" rel="prev" title="Hexo 部署 Gitee pages">
                  <i class="fa fa-chevron-left"></i> Hexo 部署 Gitee pages
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/hexo/blog/hexo/hexo-config/" rel="next" title="Hexo 配置">
                  Hexo 配置 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">zonggc</span>
</div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
      <span>站点总字数：</span>
    <span title="站点总字数">4k</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span>站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">13 分钟</span>
  </span>
</div><script color="0,0,255" opacity="0.5" zIndex="-1" count="99" src="https://lib.baomitu.com/canvas-nest.js/1.0.1/canvas-nest.js"></script>


    </div>
  </footer>

  
  <div class="reading-progress-bar"></div>

  <a href="https://github.com/zonggc" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pangu/4.0.7/pangu.min.js" integrity="sha256-j+yj56cdEY2CwkVtGyz18fNybFGpMGJ8JxG3GSyO2+I=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>




  <script src="/js/third-party/pace.js"></script>

  





</body>
</html>
